package com.inspur.edp.common.expr.expresses.setvalue;

import com.inspur.edp.common.expr.Express;
import com.inspur.edp.common.expr.ExpressDSLGenerator;
import com.inspur.edp.common.expr.ExpressDSLGeneratorMgr;
import com.inspur.edp.common.expr.ast.ASTContext;

/**
 * @author lizhaorui
 * @date 2025/9/24
 * @description
 */
public class AssignValueDSL implements ExpressDSLGenerator {

    @Override
    public String getKind() {
        return SetValueExpr.KIND;
    }

    @Override
    public String generate(ASTContext context, Express express) {
        AssignValueExpr assignValueExpr = (AssignValueExpr) express;
        String expressDsl = ExpressDSLGeneratorMgr.generateDsl(context, assignValueExpr.getLeftExpress());
        String valueExprDsl = ExpressDSLGeneratorMgr.generateDsl(context, assignValueExpr.getRightExpress());
        return expressDsl + " = " + valueExprDsl;
    }

}
